//
// Created by jsjxsy on 2022/9/1.
//
#include "01_14_5_exce.h"
abstr_emp::abstr_emp() : fname("\0"), lname("\0"), job("\0") {

}
abstr_emp::abstr_emp(const std::string &fn, const std::string &ln, const std::string &j)
    : fname(fn), lname(ln), job(j) {
}
abstr_emp::abstr_emp(const abstr_emp &ae) {
  fname = ae.fname;
  lname = ae.lname;
  job = ae.job;
}
void abstr_emp::ShowAll() const {
  cout << "fname=" << fname << ", lname=" << lname << ", job=" << job << endl;
}
void abstr_emp::setAll() {
  cout << "please input first name:" << endl;
  cin >> fname;
  cout << "please input last name:" << endl;
  cin >> lname;
  cout << "please input job:" << endl;
  cin >> job;
}

abstr_emp::~abstr_emp() {
  cout << "~abstr_emp" << endl;
}

std::ostream &operator<<(std::ostream &os, const abstr_emp &e) {
  os << "fname=" << e.fname << ", lname=" << e.lname << ", job=" << e.job << endl;
  return os;
}

employee::employee() : abstr_emp() {}
employee::employee(const std::string &fn, const std::string &ln, const std::string &j) : abstr_emp(fn, ln, j) {
}

void employee::ShowAll() const {
  abstr_emp::ShowAll();
}

void employee::setAll() {
  abstr_emp::setAll();
}

manager::manager() : abstr_emp(), inchargeof(0) {}
manager::manager(const std::string &fn, const std::string &ln, const std::string &j, int ico)
    : abstr_emp(fn, ln, j), inchargeof(ico) {}
manager::manager(const abstr_emp &e, int ico) : abstr_emp(e), inchargeof(ico) {}
manager::manager(const manager &m) : abstr_emp(m) {
  inchargeof = m.inchargeof;
}
void manager::ShowAll() const {
  abstr_emp::ShowAll();
  cout << "inchargeof:" << InChargeOf() << endl;
}

void manager::setAll() {
  abstr_emp::setAll();
  cout << "please input inchargeof:" << endl;
  cin >> inchargeof;
}

fink::fink() : abstr_emp(), reportsto("\0") {}
fink::fink(const std::string &fn, const std::string &ln, const std::string &j, const std::string &rpo) : abstr_emp(fn,
                                                                                                                   ln,
                                                                                                                   j),
                                                                                                         reportsto(rpo) {

}
fink::fink(const abstr_emp &e, const std::string &rpo) : abstr_emp(e), reportsto(rpo) {}
fink::fink(const fink &f) : abstr_emp(f) {
  reportsto = f.reportsto;
}
void fink::ShowAll() const {
  abstr_emp::ShowAll();
  cout << "reportsto : " << reportsto << endl;
}
void fink::setAll() {
  abstr_emp::setAll();
  cout << "please input reportsto:" << endl;
  cin >> reportsto;
}

highfink::highfink() : manager(), fink() {}
highfink::highfink(const std::string &fn, const std::string &ln, const std::string &j, const std::string &rpo, int ico)
    : abstr_emp(fn, ln, j), manager(fn, ln, j, ico), fink(fn, ln, j, rpo) {

}
highfink::highfink(const abstr_emp &e, const std::string &rpo, int ico) : abstr_emp(e), manager(e, ico), fink(e, rpo) {}
highfink::highfink(const fink &f, int ico) : abstr_emp(f), manager(f, ico), fink(f) {
}
highfink::highfink(const manager &m, const std::string &rpo) : abstr_emp(m), manager(m), fink(m, rpo) {}
highfink::highfink(const highfink &h) : abstr_emp(h), manager(h), fink(h) {}
void highfink::ShowAll() const {
//  abstr_emp::ShowAll();
//  cout << "inchargeof : " << InChargeOf() << endl;
//  cout << "reportsto : " << ReportsTo() << endl;
  manager::ShowAll();
  fink::ShowAll();
}
void highfink::setAll() {
//  abstr_emp::setAll();
//  cout << "please input reportsto:" << endl;
//  string &rpo = ReportsTo();
//  cin >> rpo;
//  cout << "please input inchargeof:" << endl;
//  int &i = InChargeOf();
//  cin >> i;
  manager::setAll();
  fink::setAll();
}
